package com.example.transvipm;

import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.telephony.TelephonyManager;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class Imei extends Activity {
	TextView imei;
	TextView sim;
	TextView mac;
	Button but;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_imei);
		imei = (TextView) findViewById(R.id.textImei);
		sim = (TextView) findViewById(R.id.textSim);
		but = (Button) findViewById(R.id.botonimei);
		mac = (TextView) findViewById(R.id.textMac);
		this.deleteDatabase("databaseTv.db");
		but.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
				imei.setText(telephonyManager.getDeviceId());
				sim.setText(telephonyManager.getSimSerialNumber());
				WifiManager wimanager = (WifiManager) getSystemService(Context.WIFI_SERVICE);

				mac.setText(wimanager.getConnectionInfo().getMacAddress());

			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.imei, menu);
		return true;
	}

	



}
